<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="afragment::head(~{::title})">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>管理用户</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
  <link rel="stylesheet" href="../../static/css/me.css" >
</head>
<body>

  <!--导航-->
  <nav th:replace="afragment::menu(1)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small" >
    <div class="ui container">
      <div class="ui inverted secondary stackable menu">
        <h2 class="ui teal header item">后台管理</h2>
        <a href="UserManage.html" class="item"><i class="mini user icon"></i>人员管理</a>
        <a href="PostManage.html" class="item"><i class="mini file icon"></i>启事管理</a>
        <a href="NoticeManage.html" class="item"><i class="mini bell icon"></i>公告管理</a>
        <a href="FeedbackManage.html" class="item"><i class="mini envelope icon"></i>反馈管理</a>
        <a href="../static/index.html" class="item"><i class="mini home icon"></i>进入主页</a>
		<div class="right m-item  menu">
          <div class="ui dropdown  item">
            <div class="text" id="loginA">
              <img  class="ui avatar image" th:src="@{${session.localUser.photo}}">
              [[${session.localUser.username}]]
            </div>
            <i class="dropdown icon"></i>
            <div class="menu">
              <a href="#" class="item">注销</a>
            </div>
          </div>
        </div>
      </div>
    </div>
    
  </nav>

  <div  class="m-container-small m-padded-tb-big">
    <div class="ui container">
      <form th:action="@{/admin/searchUser}" method="get" class="ui segment form">
        <div class="inline fields">
			
          <div class="field" style="margin-top: 1em;">
            <input type="text" name="search" placeholder="输入要查询的用户名">
          </div>
          <div class="field" style="margin-top: 1em;">
            <button class="ui mini teal basic button"><i class="search icon"></i>搜索</button>
          </div>
        </div>
      </form>
  
      <table class="ui celled table">
        <thead>
          <tr>
            <th>userId</th>
            <th>用户名</th>
            <th>Email</th>
			<th>性别</th>
			<th>年龄</th>
			<th>个性签名</th>
            <th>上次登录</th>
            <th>是否为管理员</th>
          </tr>
        </thead>
        <tbody>
          <tr th:each="user:${users}">
            <td th:text="${user.id}">1</td>
            <td th:text="${user.username}">Moon</td>
            <td th:text="${user.email}">2652517421@qq.com</td>
			<td th:text="${user.sex}">女</td>
			<td th:text="${user.age}">20</td>
			<td th:text="${user.personalSay}">还没想好。</td>
            <td th:text="${#dates.format(user.lastTime,('yyyy-YY-dd HH:mm:ss')) }">2020-5-31 09:45</td>
            <td th:text="${user.admin} eq 'true'?'是':'否'">是</td>
          </tr>
        </tbody>
        <tfoot>
          <tr>
            <th colspan="9">
              
             <div th:if="${pageInfo}!=null" class="ui middle aligned two column grid">
                 <div class="column">
                     <a th:if="${pageInfo.prePage}!=0" th:href="${#request.getRequestURL()}+'?page='+${pageInfo.prePage}" class="ui teal basic button">上一页</a>
                 </div>
                 <div class="right aligned column">
                     <a th:if="${pageInfo.nextPage} <= ${pageInfo.pages}" th:href="${#request.getRequestURL()}+'?page='+${pageInfo.nextPage}" class="ui teal basic button">下一页</a>
                 </div>
                 <div class="center column">
                     <label>总共[[${pageInfo.pages}]]页，当前第[[${pageInfo.pageNum}]]页</label>
                 </div>
             </div>
            </th>
          </tr>
        </tfoot>
      </table>
    </div>
  </div>
 
  

  <br>
  <br>
  <!-- 底部footer -->
  <footer th:replace="afragment::footer" class="ui inverted vertical segment m-padded-tb-massive ">
    <div class="ui center aligned container">
      <div class="ui inverted divided grid">
        <div class="three wide column">
          <div class="ui inverted link list">
            <div class="item">
              <img src="../static/images/DLMU.svg" class="ui rounded image" alt="" style="width: 110px;">
            </div>
          </div>
        </div>
        <div class="three wide column">
          <h4 class="ui inverted header m-text-thin m-text-spaced ">常见问题</h4>
          <div class="ui inverted link list">
            <a href="../problems.html" class="item">点击查看</a>
            <a href="../feedback.html" class="item" >点击反馈</a>
          </div>
        </div>
        <div class="three wide column">
          <h4 class="ui inverted header m-text-thin m-text-spaced ">如何联系</h4>
          <div class="ui inverted link list">
            <a href="#" class="item m-text-thin">Email：xxxxxxxx@qq.com</a>
            <a href="#" class="item m-text-thin">QQ：xxxxxxxx</a>
          </div>
        </div>
        <div class="seven wide column">
          <h4 class="ui inverted header m-text-thin m-text-spaced ">关于我们</h4>
          <p class="m-text-thin m-text-spaced m-opacity-mini">LostFound</p>
        </div>
      </div>
      <div class="ui inverted section divider"></div>
      <p class="m-text-thin m-text-spaced m-opacity-tiny">Copyright © 2025 - 3000 LostFound Designed by DLMU-LZT</p>
    </div>
  </footer>

  <!--	/*/<th:block th:replace="fragment::script">/*/-->
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
  <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
  <!--    /*/</th:block>/*/-->

  <script>
    $('.ui.dropdown').dropdown({
      on : 'hover'
    });
	$(function () {
	    $(".ui.fluid.teal.button").on("click",function () {
	        $(".ui.modal").modal("show");
	    })
	});
  </script>

</body>
</html>